/***********************************************************
 * Product Name: ExcelQuicker
 * Copyright (c)2005, Eunge
 * Author: Eunge
 * Web Site: www.eudev.net
 * Mail/MSN: eudev.net@yeah.net
 * ********************************************************/
namespace ExcelQuicker.Framework
{
	/// <summary>
	/// Convert enum of ExcelQuicker or Excel COM into the other
	/// </summary>
	public sealed class EQEnumKit
	{
		private EQEnumKit(){}


		/// <summary>
		/// Convert EQDataLabels enum into Excel.XlDataLabelsType
		/// </summary>
		/// <param name="v"></param>
		/// <returns></returns>
		public static Excel.XlDataLabelsType ToXlDataLabelsType(EQDataLabelsType v)
		{
			switch(v)
			{
				case EQDataLabelsType.ShowNone:
					return Excel.XlDataLabelsType.xlDataLabelsShowNone;
				case EQDataLabelsType.ShowLabel:
					return Excel.XlDataLabelsType.xlDataLabelsShowLabel;
				case EQDataLabelsType.ShowPercent:
					return Excel.XlDataLabelsType.xlDataLabelsShowPercent;
				case EQDataLabelsType.ShowLabelAndPercent:
					return Excel.XlDataLabelsType.xlDataLabelsShowLabelAndPercent;
				case EQDataLabelsType.ShowBubbleSizes:
					return Excel.XlDataLabelsType.xlDataLabelsShowBubbleSizes;
				case EQDataLabelsType.ShowValue:
					return Excel.XlDataLabelsType.xlDataLabelsShowValue;
				default:
					return Excel.XlDataLabelsType.xlDataLabelsShowNone;
			}
		}


		/// <summary>
		/// Convert Excel.XlDataLabelsType enum into EQDataLabelsType
		/// </summary>
		/// <param name="v"></param>
		/// <returns></returns>
		public static EQDataLabelsType ToEQDataLabelsType(Excel.XlDataLabelsType v)
		{
			switch(v)
			{
				case Excel.XlDataLabelsType.xlDataLabelsShowBubbleSizes:
					return EQDataLabelsType.ShowBubbleSizes;
				case Excel.XlDataLabelsType.xlDataLabelsShowLabel:
					return EQDataLabelsType.ShowLabel;
				case Excel.XlDataLabelsType.xlDataLabelsShowLabelAndPercent:
					return EQDataLabelsType.ShowLabelAndPercent;
				case Excel.XlDataLabelsType.xlDataLabelsShowNone:
					return EQDataLabelsType.ShowNone;
				case Excel.XlDataLabelsType.xlDataLabelsShowPercent:
					return EQDataLabelsType.ShowPercent;
				case Excel.XlDataLabelsType.xlDataLabelsShowValue:
					return EQDataLabelsType.ShowValue;
				default:
					return EQDataLabelsType.ShowNone;
			}
		}


		/// <summary>
		/// Convert EQColumnChartType enum into Excel.XlChartType
		/// </summary>
		/// <param name="v"></param>
		/// <returns></returns>
		public static Excel.XlChartType ToXlChartType(EQColumnChartType v)
		{
			switch(v)
			{
				case EQColumnChartType.Column3D:
					return Excel.XlChartType.xl3DColumn;
				case EQColumnChartType.Column3DClustered:
					return Excel.XlChartType.xl3DColumnClustered;
				case EQColumnChartType.Column3DStacked:
					return Excel.XlChartType.xl3DColumnStacked;
				case EQColumnChartType.Column3DStacked100:
					return Excel.XlChartType.xl3DColumnStacked100;
				case EQColumnChartType.ColumnClustered:
					return Excel.XlChartType.xlColumnClustered;
				case EQColumnChartType.ColumnStacked:
					return Excel.XlChartType.xlColumnStacked;
				case EQColumnChartType.ColumnStacked100:
					return Excel.XlChartType.xlColumnStacked100;
				default:
					return Excel.XlChartType.xlColumnClustered;
			}
		}


		/// <summary>
		/// Convert Excel.XlChartType enum into EQColumnChartType
		/// </summary>
		/// <param name="v"></param>
		/// <returns></returns>
		public static EQColumnChartType ToEQColumnChartType(Excel.XlChartType v)
		{
			switch(v)
			{
				case Excel.XlChartType.xl3DColumn:
					return EQColumnChartType.Column3D;
				case Excel.XlChartType.xl3DColumnClustered:
					return EQColumnChartType.Column3DClustered;
				case Excel.XlChartType.xl3DColumnStacked:
					return EQColumnChartType.Column3DStacked;
				case Excel.XlChartType.xl3DColumnStacked100:
					return EQColumnChartType.Column3DStacked100;
				case Excel.XlChartType.xlColumnClustered:
					return EQColumnChartType.ColumnClustered;
				case Excel.XlChartType.xlColumnStacked:
					return EQColumnChartType.ColumnStacked;
				case Excel.XlChartType.xlColumnStacked100:
					return EQColumnChartType.ColumnStacked100;
				default:
					return EQColumnChartType.ColumnClustered;
			}
		}


		/// <summary>
		/// Convert EQLineChartType enum into Excel.XlChartType
		/// </summary>
		/// <param name="v"></param>
		/// <returns></returns>
		public static Excel.XlChartType ToXlChartType(EQLineChartType v)
		{
			switch(v)
			{
				case EQLineChartType.Line:
					return Excel.XlChartType.xlLine;
				case EQLineChartType.Line3D:
					return Excel.XlChartType.xl3DLine;
				case EQLineChartType.LineMarkers:
					return Excel.XlChartType.xlLineMarkers;
				case EQLineChartType.LineMarkersStacked:
					return Excel.XlChartType.xlLineMarkersStacked;
				case EQLineChartType.LineMarkersStacked100:
					return Excel.XlChartType.xlLineMarkersStacked100;
				case EQLineChartType.LineStacked:
					return Excel.XlChartType.xlLineStacked;
				case EQLineChartType.LineStacked100:
					return Excel.XlChartType.xlLineStacked100;
				default:
					return Excel.XlChartType.xlLine;
			}
		}


		/// <summary>
		/// Convert EQLineChartType enum into Excel.XlChartType
		/// </summary>
		/// <param name="v"></param>
		/// <returns></returns>
		public static EQLineChartType ToEQLineChartType(Excel.XlChartType v)
		{
			switch(v)
			{
				case Excel.XlChartType.xlLine:
					return EQLineChartType.Line;
				case Excel.XlChartType.xl3DLine:
					return EQLineChartType.Line3D;
				case Excel.XlChartType.xlLineMarkers:
					return EQLineChartType.LineMarkers;
				case Excel.XlChartType.xlLineMarkersStacked100:
					return EQLineChartType.LineMarkersStacked100;
				case Excel.XlChartType.xlLineMarkersStacked:
					return EQLineChartType.LineMarkersStacked;
				case Excel.XlChartType.xlLineStacked:
					return EQLineChartType.LineStacked;
				case Excel.XlChartType.xlLineStacked100:
					return EQLineChartType.LineStacked100;
				default:
					return EQLineChartType.Line;
			}
		}

	}
}
